package cn.meye11.crm.domain.entity;

import cn.meye11.crm.domain.model.Member;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import tk.mybatis.mapper.annotation.LogicDelete;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 会员信息表(Member)类
 *
 * @author makejava
 * @since 2023-11-15 11:36:56
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = MemberEntity.Table)
public class MemberEntity implements Serializable {

    public static final String Table = "t_member";
    private static final long serialVersionUID = 831892941207018748L;
    
    public MemberEntity(Member model) {
        BeanUtils.copyProperties(model, this);
    }

    /* 会员id */
    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(insertable = false)
    private Long id;
    /* 姓名 */
    private String name;
    /* 手机 */
    private String mobile;
    /* 账户充值余额 */
    private Double rechargeBalance;
    /* 赠送余额 */
    private Double giftBalance;
    /* 充值次数 */
    private Integer times;
    /* 邮箱 */
    private String mail;
    /* 地址 */
    private String address;
    /* 性别 */
    private String sex;
    /* 生日 */
    private Date birthday;
    /* 注册日期 */
    private Date registrationDate;
    /* 会员类型 */
    private String memberType;
    /* 会员积分 */
    private Integer integral;
    /* 客户经理 */
    private String accountManager;
    /* 客户画像标签 */
    private String label;
    /* 是否删除 */
    @LogicDelete
    private Integer del;
    /* 最后修改时间 */
    private LocalDateTime last;
    /* 创建时间 */
    private LocalDateTime time;
    /* 创建人 */
    private String createdBy;
    /* 最后修改人 */
    private String modifiedBy;
    /* 版本 */
//    @Version
    private Integer version;
}
